package com.lin.setting.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.lin.setting.setting.desensitization.Desensitization;
import com.lin.setting.setting.desensitization.handler.PasswordDesensitizationHandler;
import com.lin.setting.setting.desensitization.handler.PhoneDesensitizationHandler;
import com.lin.setting.setting.type.TestTypeHandler;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @作者: 林江
 * @创建时间: 2024/5/2
 * @功能:
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@TableName("sys_user")
public class SysUser {
    @TableId(type = IdType.AUTO)
    private Integer id;
    private String name;
    private String username;
    // 可以处理加密或解密字段
    @TableField(typeHandler = TestTypeHandler.class)
    @Desensitization(handler = PasswordDesensitizationHandler.class)
    private String password;
    private String openId;
    @Desensitization(handler = PhoneDesensitizationHandler.class)
    private String phone;
}
